package com.gs.SynPatrolRep.adapter;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import java.util.List;

public class TabLayoutPagerAdapter extends FragmentStatePagerAdapter {
    private List<Fragment> mListFg;
    private List<String> mListTitle;

    public TabLayoutPagerAdapter(FragmentManager fm, List<Fragment> fragmentList, List<String> titleList) {
        super(fm);

        this.mListFg = fragmentList;
        this.mListTitle = titleList;
    }

    @Override
    public Fragment getItem(int position) {
        return mListFg.get(position);
    }

    @Override
    public int getCount() {
        return mListTitle.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return mListTitle.get(position);
    }
}
